import request from '../utils/request'

export function loginApi(params:any) {
    return request({ // 返回request请求
        url: '/api/login/index', // 请求接口的地址
        method: 'post', // 请求方式是post 还有get等方法(了解)
        data: params // 请求的数据是loginform 在验证请求的时候可能请求的值为value
    })
}

export function loginOutApi() {
    return request({
        url: '/api/login/logout',
        method: 'get',
        data: null
    })
}

export function registerApi(params:any) {
    return request({
        url: '/api/register/index',
        method: 'post',
        data: params
    })
}

export function getUserInfoApi() {
    return request({
        url: '/api/user/getInfo',
        method: 'get',
        data: null
    })
}

export function editPassword(params:any) {
    return request({
        url: '/api/user/editPassword',
        method: 'post',
        data: params
    })
}

export function editPayPassword(params:any) {
    return request({
        url: '/api/user/editPayPassword',
        method: 'post',
        data: params
    })
}

export function auth(params:any) {
    return request({
        url: '/api/user/auth',
        method: 'post',
        data: params
    })
}

export function authInfo() {
    return request({
        url: '/api/user/auth',
        method: 'get',
        data: null
    })
}